<template>
    <page-body>
        <view class="page">
            <view class="flex benben-position-layout flex flex-wrap align-center myCoupon_flex_0" :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
                <view class='flex flex-wrap align-center justify-between flex-sub myCoupon_fd0_0'>
                    <view class='flex flex-wrap align-center myCoupon_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
                        <text class='fu-iconfont2  myCoupon_fd0_0_c0_c0'>&#xe794;</text>
                    </view>
                    <view class='flex flex-wrap align-center'>
                        <text class='myCoupon_fd0_0_c1_c0'>我的优惠券</text>
                        <view class='flex flex-wrap align-center myCoupon_fd0_0_c1_c1' @tap.stop="popupShow1716435406954=true">
                            <text class='fu-iconfont2  myCoupon_fd0_0_c1_c1_c0'>&#xe60a;</text>
                        </view>
                    </view>
                    <view class='flex flex-wrap align-center justify-end myCoupon_fd0_0_c0'>
                    </view>
                </view>

            </view>
            <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
            <!---flex布局flex布局开始-->
            <view class="flex benben-flex-layout flex-wrap align-center">
                <view>
                    <benben-flex-tabs class-name='myCoupon_benbenTabsfd1_0' v-model="tabs" ref="benben_tabsfd1_0" select-mark="benben_tabsfd1_0" 
					key="benben_tabsfd1_0" :open-title-type='false' :open-sticky='true' :top='88' :is-show-content='false' :scrollspy='false' 
					:tabs-info.sync="tabsInfofd1_0" @change="daioyong">

                        <scroll-view @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd1_0" class="benben-tabs" style="width:750rpx" :scroll-x="true" :scroll-left.sync="tabsInfofd1_0.moveX" scroll-with-animation="all .3s ease">
                            <view class="benben-tabs-content" id="benben_tabsfd1_0-content">
                                <view id="benben_tabsfd1_0-title" class="benben-tabs-title flex align-center justify-around flex ">
                                    <view :class="{ 'checkTitlefd1_0': tabs == '-1', 'flex flex-wrap align-center': true }" @tap="tabs = '-1'" :id="`benben_tabsfd1_0-title-item-${'-1'}`">

                                        <text>全部</text>

                                    </view>
                                    <view :class="{ 'checkTitlefd1_0': tabs == '0', 'flex flex-wrap align-center': true }" @tap="tabs = '0'" :id="`benben_tabsfd1_0-title-item-${'0'}`">

                                        <text>未使用</text>

                                    </view>
                                    <view :class="{ 'checkTitlefd1_0': tabs == '2', 'flex flex-wrap align-center': true }" @tap="tabs = '2'" :id="`benben_tabsfd1_0-title-item-${'2'}`">

                                        <text>已使用</text>

                                    </view>
                                    <view :class="{ 'checkTitlefd1_0': tabs == '3', 'flex flex-wrap align-center': true }" @tap="tabs = '3'" :id="`benben_tabsfd1_0-title-item-${'3'}`">

                                        <text>已过期</text>

                                    </view>
                                </view>
                                <view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}" id="benben_tabsfd1_0-line" class="benben-tabs-line flex benben-flex-tabs-line myCoupon_linefd1_0"></view>
                            </view>
                        </scroll-view>

                    </benben-flex-tabs>

                </view>
            </view>

            <!---flex布局flex布局结束-->
            <!---flex布局flex布局开始-->
			<fu-loading v-if="isShow"></fu-loading>
            <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout myCoupon_flex_2" v-else>
                <template v-for='(item,key0) in list'>
                    <view class='flex flex-direction flex-wrap align-stretch' :key='key0'>
                        <view class='flex flex-direction flex-wrap align-stretch myCoupon_fd2_0_c0' v-if=" item.status==0">
                            <view class='flex flex-wrap align-center myCoupon_fd2_0_c0_c0'>
                                <image class='myCoupon_fd2_0_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"83.png"'></image>
                                <view class='flex flex-wrap align-center flex-sub'>
                                    <view class='flex flex-direction flex-wrap align-stretch flex-sub'>
                                        <text class='myCoupon_fd2_0_c0_c0_c1_c0_c0'>{{item.operationcoupon_name}}</text>
                                        <text class='myCoupon_fd2_0_c0_c0_c1_c0_c1'>{{item.subtitle}}</text>
                                    </view>
                                    <view class='flex flex-wrap align-end'>
                                        <text class='myCoupon_fd2_0_c0_c0_c1_c1_c0'>￥</text>
                                        <text class='myCoupon_fd2_0_c0_c0_c1_c1_c1'>{{item.money}}</text>
                                    </view>
                                </view>
                            </view>
                            <view class='flex flex-wrap align-center myCoupon_fd2_0_c0_c1'>
                                <text class='myCoupon_fd2_0_c0_c1_c0'>有效期至：</text>
                                <text class='myCoupon_fd2_0_c0_c1_c0'>{{item.end_time}}</text>
                                <button class='myCoupon_fd2_0_c0_c1_c2'>未使用</button>
                            </view>
                        </view>
                        <view class='flex flex-direction flex-wrap align-stretch myCoupon_fd2_0_c1' v-if=" item.status!='0'">
                            <view class='flex flex-wrap align-center myCoupon_fd2_0_c0_c0'>
                                <image class='myCoupon_fd2_0_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"13.png"'></image>
                                <view class='flex flex-wrap align-center flex-sub'>
                                    <view class='flex flex-direction flex-wrap align-stretch flex-sub'>
                                        <text class='myCoupon_fd2_0_c0_c0_c1_c0_c0'>{{item.operationcoupon_name}}</text>
                                        <text class='myCoupon_fd2_0_c0_c0_c1_c0_c1'>{{item.subtitle}}</text>
                                    </view>
                                    <view class='flex flex-wrap align-end'>
                                        <text class='myCoupon_fd2_0_c1_c0_c1_c1_c0'>￥</text>
                                        <text class='myCoupon_fd2_0_c1_c0_c1_c1_c1'>{{item.money}}</text>
                                    </view>
                                </view>
                            </view>
                            <view class='flex flex-wrap align-center myCoupon_fd2_0_c0_c1'>
                                <text class='myCoupon_fd2_0_c1_c1_c0'>有效期至：</text>
                                <text class='myCoupon_fd2_0_c1_c1_c0'>{{item.end_time}}</text>
                                <button class='myCoupon_fd2_0_c1_c1_c2' v-if=" item.status==3">已过期</button>
								<button class='myCoupon_fd2_0_c1_c1_c2' v-if=" item.status=='2'">已使用</button>
								<button class='myCoupon_fd2_0_c1_c1_c2' v-if=" item.status=='1'">已占用</button>
                            </view>
                        </view>
                    </view>
                </template>
				<view v-if="list.length == 0" class="text-xl text-center text-gray flex flex-direction align-center justify-center"
					style="margin-top: 20%;">
					<image :src='STATIC_URL+"137.png"' mode="widthFix" style="width:400rpx;"></image>
				</view>

            </view>

            <!---flex布局flex布局结束-->
            <benben-popup v-model="popupShow1716435406954" :mask="true" :mask-close-able="true" mode='bottom'>
                <!---配送费弹窗flex布局开始-->
                <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout myCoupon_flex_3">
                    <view class='flex flex-wrap align-center justify-between myCoupon_fd3_0'>
                        <view class='flex flex-wrap align-center myCoupon_fd3_0_c0'>
                        </view>
                        <text class='myCoupon_fd3_0_c1'>优惠券说明</text>
                        <image class='myCoupon_fd3_0_c0' mode="aspectFit" :src='STATIC_URL+"48.png"' @tap.stop="popupShow1716435406954=false"></image>
                    </view>

                    <scroll-view class='myCoupon_fd3_1' :scroll-x='true' :scroll-y='true' :show-scrollbar='true'>
                        <view class='flex flex-direction align-center benben-scroll flex'>
                            <jyf-parser class='myCoupon_fd3_1_c0' :html="detail.content | richTextFormat">
                            </jyf-parser>
                        </view>
                    </scroll-view>

                </view>

                <!---配送费弹窗flex布局结束-->

            </benben-popup>


        </view>
    </page-body>
</template>
<script>
    import {
        validate
    } from '@/common/utils/validate.js'

    export default {
        components: {},


        data() {
            return {
                "popupShow1716435406954": false,
                "tabsInfofd1_0": {
                    lineleft: '',
                    lineWidth: '',
                    moveX: 0,
                    scrollX: 0,
                    PageScrollX: 0
                },
                "tabs": "-1",
                "detail": {
                    "aid": "",
                    "type": "",
                    "content": "",
                    "create_time": ""
                },
                "list": [],
				isShow:false
            };
        },
        computed: {

        },
        watch: {},
        onLoad(options) {
			this.isShow = true
        },
        onUnload() {

        },
        onReady() {

        },
        onShow() {
            this.getkm46576063f6b7Func()
            this.getac4a67eff81d29Func()
        },
        onHide() {

        },
        onResize() {

        },
        onPullDownRefresh() {
			this.getkm46576063f6b7Func()
			this.getac4a67eff81d29Func()
			setTimeout(function () {
				uni.stopPullDownRefresh();
			}, 1000);
        },
        onReachBottom(e) {

        },
        onPageScroll(e) {

        },
        methods: {
			daioyong(){
				this.isShow = true
				this.getac4a67eff81d29Func()
			},
            //注册协议隐私政策
            async getkm46576063f6b7Func() {
                //请求方法
                //数据验证

                let datadetail = await this.$api.get(global.apiUrls.post646576063f6b7, {
                    aid: '24'
                });

                if (datadetail.data.code != 1) {
                    this.$message.info(datadetail.data.msg);
                    return
                }
                let infodetail = datadetail.data;
                this.detail = infodetail.data

            },
            //会员优惠券
            async getac4a67eff81d29Func() {
                //请求方法
                //数据验证

                let datalist = await this.$api.get(global.apiUrls.post64a67eff81d29, {
                    is_store: '0',
                    status: this.tabs
                });

                if (datalist.data.code != 1) {
                    this.$message.info(datalist.data.msg);
                    return
                }
                let infolist = datalist.data;
                this.list = infolist.data
				// console.log( this.list,'数据')
				this.isShow = false

            }
        }
    };
</script>
<style lang="scss" scoped>
    .page {
        width: 100vw;
        overflow-x: hidden;
        min-height: calc(100vh - var(--window-bottom));
        background: rgba(248, 248, 248, 1);
        background-size: 100% auto;
    }

    .myCoupon_flex_0 {
        background: #fff;
        width: 750rpx;
        height: 88rpx;
        overflow: hidden;
        z-index: 10;
        top: 0rpx;
        background-size: 100% auto !important;
    }

    .myCoupon_fd0_0_c1_c1_c0 {
        font-size: 26rpx;
        color: #333;
    }

    .myCoupon_fd0_0_c1_c1 {
        margin: 0rpx 0rpx 0rpx 8rpx;
    }

    .myCoupon_fd0_0_c1_c0 {
        font-size: 36rpx;
        font-weight: 500;
        color: #333;
    }

    .myCoupon_fd0_0_c0_c0 {
        font-size: 32rpx;
        color: #333;
    }

    .myCoupon_fd0_0_c0 {
        width: 120rpx;
        height: 88rpx;
    }

    .myCoupon_fd0_0 {
        padding: 0rpx 32rpx 0rpx 32rpx;
        height: 88rpx;
    }

    .myCoupon_linefd1_0 {
        background: url(image-path('52.png')) no-repeat;
        width: 32rpx;
        height: 12rpx;
        top: 70rpx;
        background-size: 100% auto !important;
        border-radius: 10rpx 10rpx 10rpx 10rpx;
    }

    .checkTitlefd1_0 {
        font-weight: 500 !important;
        font-size: 28rpx !important;
        color: #333333 !important;
        background-color: rgba(255, 255, 255, 1) !important;
    }

    ::v-deep .myCoupon_benbenTabsfd1_0 {
        background: #fff;
        width: 750rpx;
        height: 88rpx;
        white-space: nowrap;
        font-size: 28rpx;
        font-weight: 400;
        color: var(--benbenFontColor1);
    }

    .myCoupon_flex_2 {
        padding: 24rpx 32rpx 0rpx 32rpx;
    }

    .myCoupon_fd2_0_c1_c1_c2 {
        background: rgba(153, 153, 153, 1);
        border-radius: 24rpx 24rpx 24rpx 24rpx;
        width: 144rpx;
        line-height: 48rpx;
        font-size: 24rpx;
        color: #fff;
        margin: 0rpx 0rpx 0rpx auto;
        height: 48rpx;
    }

    .myCoupon_fd2_0_c1_c1_c0 {
        color: rgba(153, 153, 153, 1);
        font-size: 24rpx;
        font-weight: 400;
        line-height: 33rpx;
    }

    .myCoupon_fd2_0_c1_c0_c1_c1_c1 {
        color: rgba(153, 153, 153, 1);
        font-size: 49rpx;
        font-weight: 600;
        line-height: 69rpx;
    }

    .myCoupon_fd2_0_c1_c0_c1_c1_c0 {
        color: rgba(153, 153, 153, 1);
        font-size: 33rpx;
        font-weight: 600;
        line-height: 67rpx;
    }

    .myCoupon_fd2_0_c1 {
        background: url(image-path('12.png')) no-repeat;
        background-size: 100% auto;
        padding: 0rpx 34rpx 0rpx 34rpx;
        margin: 0rpx 0rpx 24rpx 0rpx;
    }

    .myCoupon_fd2_0_c0_c1_c2 {
        background: #FF8E21;
        border-radius: 24rpx 24rpx 24rpx 24rpx;
        width: 144rpx;
        line-height: 48rpx;
        font-size: 24rpx;
        color: #fff;
        margin: 0rpx 0rpx 0rpx auto;
        height: 48rpx;
    }

    .myCoupon_fd2_0_c0_c1_c0 {
        color: #333333;
        font-size: 24rpx;
        font-weight: 400;
        line-height: 33rpx;
    }

    .myCoupon_fd2_0_c0_c1 {
        margin: 20rpx 0rpx 30rpx 0rpx;
    }

    .myCoupon_fd2_0_c0_c0_c1_c1_c1 {
        color: #DA372C;
        font-size: 49rpx;
        font-weight: 600;
        line-height: 69rpx;
    }

    .myCoupon_fd2_0_c0_c0_c1_c1_c0 {
        color: #DA372C;
        font-size: 33rpx;
        font-weight: 600;
        line-height: 67rpx;
    }

    .myCoupon_fd2_0_c0_c0_c1_c0_c1 {
        color: #999999;
        font-size: 22rpx;
        font-weight: 400;
        line-height: 30rpx;
        margin: 0rpx 0rpx 0rpx 0rpx;
    }

    .myCoupon_fd2_0_c0_c0_c1_c0_c0 {
        color: #333333;
        font-size: 32rpx;
        font-weight: 500;
        line-height: 45rpx;
    }

    .myCoupon_fd2_0_c0_c0_c0 {
        width: 122rpx;
        height: 100rpx;
        margin: 0rpx 16rpx 0rpx 0rpx;
    }

    .myCoupon_fd2_0_c0_c0 {
        border-bottom: 2px dotted #eee;
        padding: 30rpx 0rpx 14rpx 0rpx;
    }

    .myCoupon_fd2_0_c0 {
        background: url(image-path('11.png')) no-repeat;
        background-size: 100% auto;
        padding: 0rpx 34rpx 0rpx 34rpx;
        margin: 0rpx 0rpx 24rpx 0rpx;
    }

    .myCoupon_flex_3 {
        background: #fff;
        background-size: 100% auto !important;
        border-radius: 24rpx 24rpx 0rpx 0rpx;
        padding: 0rpx 32rpx 0rpx 32rpx;
    }

    ::v-deep .myCoupon_fd3_1_c0 {
        width: 100%;
    }

    .myCoupon_fd3_1 {
        touch-action: none;
        width: 100%;
        height: 500rpx;
        margin: 0rpx 0rpx 100rpx 0rpx;
    }

    .myCoupon_fd3_0_c1 {
        line-height: 50rpx;
        font-size: 36rpx;
        font-weight: 500;
        color: #333333;
        -webkit-line-clamp: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        margin: 0rpx 16rpx 0rpx 16rpx;
    }

    .myCoupon_fd3_0_c0 {
        width: 40rpx;
        height: 40rpx;
    }

    .myCoupon_fd3_0 {
        margin: 40rpx 0rpx 44rpx 0rpx;
    }
</style>